<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位堆叠次序</title>
    <style>
        .box {
            position: absolute;
            top: 0;
            right: 0;
            width: 200px;
            height: 300px;
        }
        .xd {
            background-color: red;
            z-index: 1;
        }
        .xe {
            background-color: green;
            right: 50px;
            top: 50px;
            z-index: 2;
        }
        .gtq {
            background-color: blue;
            right: 100px;
            top: 100px;
        }
    </style>
</head>
<body>
    <div class="box xd">熊大</div>
    <div class="box xe">熊二</div>
    <div class="box gtq">光头强</div>
    <img src="img/定位堆叠次序.png" alt="">
</body>
</html>